﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Face8280WebSocketServer.Model.People
{
    /// <summary>
    /// 人员权限详情
    /// </summary>
    public class FaceAPIPeopleAccessDetail
    {
        public const string DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
        public int ID { get; set; }
        /// <summary>
        /// 通行开始时间（年-月-日 时：分：秒，例 如：”2020-03-06 16:45:20”）
        /// </summary>
        public DateTime devicePassStart { get; set; }
        /// <summary>
        /// 通行结束时间（年-月-日 时：分：秒，例 如：”2020-03-06 16:45:20”）
        /// </summary>
        public DateTime devicePassEnd { get; set; }

        /// <summary>
        /// 0:通行时间不限制 1:根据通行时间限制
        /// </summary>
        public int devicePassTimeOver { get; set; }

        /// <summary>
        /// 0 无限通行次数，其他：通行次数
        /// </summary>
        public int devicePassNumber { get; set; }

        public FaceAPIPeopleAccessDetail()
        {
            devicePassStart = DateTime.Now.AddYears(-1);
            devicePassEnd = DateTime.Now.AddYears(10);
            devicePassTimeOver = 1;
            devicePassNumber = 0;
        }

        public void SetAccessDeadline(DateTime dateTime)
        {
            devicePassStart = DateTime.Now.AddYears(-1);
            devicePassEnd = dateTime;
        }
    }
}
